<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1"><title id="da20941">DROP OPERATOR CLASS</title><body><p id="sql_command_desc">Removes an operator class.</p><section id="section2"><title>Synopsis</title><codeblock id="sql_command_synopsis">DROP OPERATOR CLASS [IF EXISTS] <varname>name</varname> USING <varname>index_method</varname> [CASCADE | RESTRICT]</codeblock></section><section id="section3"><title>Description</title><p><codeph>DROP OPERATOR</codeph> drops an existing operator class. To
run this command you must be the owner of the operator class.</p></section><section id="section4"><title>Parameters</title><parml><plentry><pt>IF EXISTS</pt><pd>Do not throw an error if the operator class does not exist. A notice
is issued in this case. </pd></plentry><plentry><pt><varname>name</varname></pt><pd>The name (optionally schema-qualified) of an existing operator class.</pd></plentry><plentry><pt><varname>index_method</varname></pt><pd>The name of the index access method the operator class is for.</pd></plentry><plentry><pt>CASCADE</pt><pd>Automatically drop objects that depend on the operator class. </pd></plentry><plentry><pt>RESTRICT</pt><pd>Refuse to drop the operator class if any objects depend on it. This
is the default. </pd></plentry></parml></section><section id="section5"><title>Examples</title><p>Remove the B-tree operator class <codeph>widget_ops</codeph>: </p><codeblock>DROP OPERATOR CLASS widget_ops USING btree;</codeblock><p>This command will not succeed if there are any existing indexes that use
the operator class. Add <codeph>CASCADE</codeph> to drop such indexes
along with the operator class.</p></section><section id="section6"><title>Compatibility</title><p>There is no <codeph>DROP OPERATOR CLASS</codeph> statement in the SQL standard. </p></section><section id="section7"><title>See Also</title><p><codeph><xref href="ALTER_OPERATOR_CLASS.xml#topic1" type="topic" format="dita"/></codeph>,
            <codeph><xref href="CREATE_OPERATOR_CLASS.xml#topic1" type="topic" format="dita"
          /></codeph></p></section></body></topic>
